<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>查看学生信息</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/BX_heard.css">
    <link rel="stylesheet" href="css/BX_schoolInfo.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1437774_idtdmqh48e.css">
    <link rel="stylesheet" href="./font-awesome-4.7.0/css/font-awesome.css">
    
</head>
<body>
    <div class="heardFont"> 
        <span>学生管理</span>
        <strong class="heardDiff">/ 学生列表</strong>
        <em class="icon iconfont icon-xiugai"> 修改信息</em>
    </div>
    <div id="content">
        <div id="contLeft">
            <div class="contheard">
                基本信息
            </div>
            <div class="contFour">
                <label >姓名</label>
                <input type="text" name="" id="studentName" placeholder="请输入姓名">
                <label for="">性别</label>
                <input type="text" name="" id="setSex" placeholder="性别">
                <label for=""> 年龄</label>
                <input type="number" name="" id="studentAge" placeholder="年龄">
            </div>
            <div class="contSecond">
                <label >电话</label>
                <input type="text" name="" id="studentPhone"class="QQnum" placeholder="请输入电话">
                <label id="weixinNum">微信号</label>
                <input type="text" id="studentWX" placeholder="微信号" class="weixin">
            </div>
            <div class="contSecond">
                <label >QQ</label>
                <input type="text" name="" class="QQnum" id="studentQQ" placeholder="QQ">
                <label>意向学科</label>
                <div id="likeObj">
                    <select  id="likeStudy">
                        <option>请输入意向学科</option>
                    </select>
                    <span class='fa fa-chevron-down'></span>
                </div>
                
                
            </div>
            <div class="contFirst">
                <label >身份证号</label>
                <input type="text" name="" id="studentSFZ" placeholder="请输入身份证号码">
            </div>
            <div class="contheard">
                紧急联系人
            </div>
            <div class="contThree">
                <label >紧急联系人姓名</label>
                <input type="text" name="" id="emergencyName" placeholder="院系联系人姓名">
            </div>
            <div class="contThree">
                <label >紧急联系人电话</label>
                <input type="text" name="" id="emergencyTelephone" placeholder="院系联系人电话" >
            </div>
            <div class="contSeve">
                <label for="">与本人的关系</label>
                <input type="text" name="" id="relaTion" placeholder="院系联系人电话" class="icon iconfont icon-sanjiaoxing">
                
            </div>
        </div>
        <div id="contRight">
            <div class="contheard">
                学校信息
            </div>
            <div class="contEight">
                <label >学校名称</label>
                <input type="text" name="" id="schoolName" placeholder="请输入学校名称">
                <label >学制</label>
                <input type="text" name="" id="educationSystme" placeholder="请输入学制"  >
            </div>
            <div class="contEight">
                <label style="margin-left: 30px;">专业</label>
                <input type="text" name="" id="major" placeholder="请输入专业">
                <label >年级</label>
                <input type="text" name="" id="studentGarde" placeholder="请输入年级" >
            </div>
            <div class="contheard">
                    学生记录
            </div>
            <div class="contNine">
                <label>学生来源</label>
                <div id="likeObj1">
                    <select  id="likeStudy1">
                        <option >请输入学生来源</option>
                    </select>
                    <span class='fa fa-chevron-down'></span>
                </div>
                
                <label >缴费方式</label>
                <div id="likeObj2">
                    <select  id="likeStudy2">
                        <option >请输入缴费方式</option>
                        <option value="1"> 全款</option>
                        <option value="2">支付宝</option>
                        <option value="3">微信</option>
                        <option value="4">银行卡</option>
                        <option value="5">贷款</option>
                    </select>

                    <span class='fa fa-chevron-down'></span>
                </div>
               
            </div>
            <div class="contNine">
                <label >学费金额</label>
                <input type="text" name="" id="" placeholder="21800" disabled>
                <label id="likeType">意向类型</label>
                <div id="likeObj3">
                    <select  id="likeStudy3">
                        <option value="">请输入意向类型</option>
                    </select>

                    <span class='fa fa-chevron-down'></span>
                </div>
            </div>
            
            <div class="contheard">
                口碑联系人信息
            </div>
            <div class="newInput" id="newInput">
                <div id="schoolAddr">
                    <label >校区</label>
                    <div id="likeObj4">
                        <select  id="likeStudy4">
                            <option value="">请输入院校名称</option>
                        </select>
                        <span class='fa fa-chevron-down'></span>
                    </div>
                    
                </div>
                
                
                <div id="selectNews">
                    <span>
                        <p >
                            <input type="radio"class="setRadio"name="sele" id="teamN" checked="checked">
                            <em>部门</em>
                        </p>
                        <p >
                            <input type="radio" class="setRadio" name="sele" id="classN">
                            <em>班级</em>
                        </p>
                    </span>
                </div>
                <div id="Oselect">
                    <div id="likeObj5">
                        <select  id="likeStudy5">
                            <option value="">请输入部门/班级</option>
                        </select>
                       
                        <span class='fa fa-chevron-down'></span>
                    </div>
                </div>
            
                
            </div>
            <div  id="NameInput">
                <div id="NameA">
                    <label >姓名</label>
                    <div id="likeObj6">
                        <select  id="likeStudy6"></select>
                        <span class='fa fa-chevron-down'></span>
                    </div>
                </div>
               <div id="OtelPho">
                   <label >联系电话</label>
                   <div id="likeObj7"> 
                       <select  id="likeStudy7"></select>
                       <span class='fa fa-chevron-down'></span>
                   </div>
               </div>
            </div>
        </div>
        <div id="last">
            <div class="contheard">
                记录信息
            </div>
            <div id="writeInfo"> 
                <div class="lastOne">
                    <label for="">记录类型</label>
                    <input type="text" name="" id="" placeholder="记录类型">
                </div>
                <div class="lastTwo">
                    <label for="">记录类型</label>
                    <textarea autocomplete="off" placeholder="请录入记录详情" class="textWrite" style="min-height: 33px; margin-top: 0px; margin-bottom: 0px; height: 33px;"></textarea>
                </div>
            </div>
            
        </div>
        <div id="addWriteInfo">
                添加记录
        </div>
        <div id="butnBA">
            <span  class="icon iconfont icon-tijiao">提交</span>

        </div>
    </div>
    
</body>
</html>
<script src="js/jquery-3.4.1.js"></script>
<script src="css/layui/layui.js"></script>
<script src="js/drop-down option.js"></script>
<script>
    console.log(localStorage.setId)
    lxcselector("#setSex",3,["男","女","其他"],180,40,-20)
    
    lxcselector("#relaTion",5,["父子","母子","妻子","朋友","同事"],60,40,-20)
   
    
    
    lxcselector("#news",7,["迟到","看视频","看小说","人事面试","技术面试","人事模拟面试","技术模拟面试"],10,40,-25)

    $("#addWriteInfo").on("click",function(){
        $("#writeInfo").slideDown(400).css("display","block")
    })
    // 屏蔽所有得input
   

   


  
        
        
        

// 学生管理请求

        $.ajax({
            type:"post",
            url:"http://192.168.3.27:9999/oaSystem/student",
            dataType:"json",
            data:{
                method:"source"
            },
            
            success:function(data){
                console.log(data)
                var lis = data.result;
                
                for(var i=0;i<lis.length;i++){
                    $("<option value=''>"+lis[i].sourceName+"</option>").appendTo($('#likeStudy1'));

                }
            },
            error:function(xhr,ero){
                console.log(ero)
            }

        })

        // 意向学科请求

            $.ajax({
                type:"post",
                url:"http://192.168.3.27:9999/oaSystem/student",
                dataType:"json",
                data:{
                    "method":"subject",
                    "jobId":5
                },
                success:function(data){
                    console.log(data)
                    if(data.code == 200){
                        var list = data.result;
                        for(var i=0;i<list.length;i++){
                            $("<option value=''>"+list[i].subjectName+"</option>").appendTo($('#likeStudy'));
                        } 
                    }
                },
                error:function(xhr,error){
                    console.log(error)
                }
            })





        // 校区 请求


        $.ajax({
            type:"post",
            url:"http://192.168.3.27:9999/oaSystem/student",
            dataType:"json",
            data:{
                "method":"center"
            },
            success:function(data){
                console.log(data)
                if(data.code == 200){
                    var list = data.result;
                    for(var i=0;i<list.length;i++){
                        $("<option value="+ list[i].centreid +">"+list[i].centreName+"</option>").appendTo($('#likeStudy4'));
                    } 
                    $("#likeStudy4").change(function(){
                        $.ajax({
                            type:"post",
                            url:"http://192.168.3.27:9999/oaSystem/student",
                            dataType:"json",
                            data:{
                                "method":"deptment",
                                "centerId":$("#likeStudy4").val()
                            },
                            success:function(data){
                                console.log(data)
                                if(data.code == 200){
                                    $("#likeStudy5").html("")
                                    var list = data.result;
                                    for(var i=0;i<list.length;i++){
                                        $("<option value="+ list[i].deptId +">"+list[i].deptName+"</option>").appendTo($('#likeStudy5'));
                                            
                                    }
                                    $("#likeStudy5").change(function(){
                                    
                                        var Na=$('#likeStudy5').find("option:selected").val(); 
                                        console.log(Na)
                                        $.ajax({
                                            type:"post",
                                            url:"http://192.168.3.27:9999/oaSystem/student",
                                            dataType:"json",
                                            data:{
                                                "method":"claInfo",
                                                "classId":Na
                                            },
                                            success:function(data){
                                                console.log(data)
                                                if(data.code == 200){
                                                    $('#likeStudy6').html("");
                                                    $('#likeStudy7').html("");
                                                    var list = data.result;
                                                    for(var i=0;i<list.length;i++){
                                                        $("<option value=''>"+list[i].studentName+"</option>").appendTo($('#likeStudy6'));
                                                        $("<option value=''>"+list[i].telphone+"</option>").appendTo($('#likeStudy7'));
                                                    }
                                                
                                                }
                                            },
                                            error:function(xhr,error){
                                                console.log(error)
                                                console.log(1)
                                            }
                                        })
                                    })   
                                }
                            },
                            error:function(xhr,error){
                                console.log("2")
                                console.log(error)
                            }
                        })
                    })
                    
                }
                
            },
            error:function(xhr,error){
                    console.log(error)
                }


        })   
        
        // 部门请求
        $("#teamN").click(function(){
        var te=$('#likeStudy4').find("option:selected").val();
        $.ajax({
            type:"post",
            url:"http://192.168.3.27:9999/oaSystem/student",
            dataType:"json",
            data:{
                "method":"deptment",
                "centerId":te
            },
            success:function(data){
                console.log(data)
                if(data.code == 200){
                    $("#likeStudy5").html("")
                    var list = data.result;
                    for(var i=0;i<list.length;i++){
                        $("<option value="+ list[i].deptId +">"+list[i].deptName+"</option>").appendTo($('#likeStudy5'));
                    }
                    $("#likeStudy5").change(function(){
                        var Na=$('#likeStudy5').find("option:selected").val(); 
                        console.log(Na)
                        $.ajax({
                            type:"post",
                            url:"http://192.168.3.27:9999/oaSystem/student",

                            dataType:"json",
                            data:{
                                "method":"claInfo",
                                "classId":Na
                            },
                            success:function(data){
                                console.log(data)
                                if(data.code == 200){
                                    $('#likeStudy6').html("");
                                    $('#likeStudy7').html("");
                                    var list = data.result;
                                    for(var i=0;i<list.length;i++){
                                        $("<option value=''>"+list[i].studentName+"</option>").appendTo($('#likeStudy6'));
                                        $("<option value=''>"+list[i].telphone+"</option>").appendTo($('#likeStudy7'));
                                    }
                                
                                }
                            },
                            error:function(xhr,error){
                                console.log(error)
                            }
                        })
                    })
                }
            },
            error:function(xhr,error){
                console.log(error)
            }
        })
        })
        // 班级请求
        $("#classN").click(function(){

        var te=$('#likeStudy4').find("option:selected").val();
        $.ajax({
            type:"post",
            url:"http://192.168.3.27:9999/oaSystem/student",
            dataType:"json",
            data:{
                "method":"clas",

                "centerId":te
            },
            success:function(data){
                console.log(data)
                if(data.code == 200){
                    $("#likeStudy5").html("")
                    var list = data.result;
                    for(var i=0;i<list.length;i++){
                        $("<option value="+ list[i].classId +">"+list[i].className+"</option>").appendTo($('#likeStudy5'));
                    }
                }
            },
            error:function(xhr,err){
                console.log(err)
            }
        })
        })




        // 提交请求
        $('#butnBA').on('click', function () {
            console.log($('#likeStudy2 ').find("option:selected").val())
        $.ajax({
            url:"http://192.168.3.27:9999/oaSystem/alterStu",
            dataType:"json",
            type:"post",
            data:{
                studentId:localStorage.setId,
                studentName:$('#studentName').val(),
                studentSex:$('#setSex').val(),
                age:$('#studentAge').val(),
                telphone:$('#studentPhone').val(),
                weixin:$('#studentWX').val(),
                qq:$('#studentQQ').val(),
                idCard:$('#studentSFZ').val(),
                emergencyName:$('#emergencyName').val(),
                emergencyContact:$('#emergencyTelephone').val(),
                relationship:$('#relaTion').val(),
                schoolId:$('#schoolName').val(),
                eductionalSystme:$('#educationSystme').val(),
                major:$('#major').val(),
                studentGarde:$('#studentGarde').val(),
                sourceld:$('#likeStudy1').val(),
                payment:$('#likeStudy2 ').find("option:selected").val(),
                inputId:$('#likeStudy3').val(),
                centreid:$('#likeStudy4').val(),
                subjectId:$('#classN').val(),
                flowDesc:$('#likeStudy6').val(),
                womTel:$('#likeStudy7').val(),
                method:'alter'
            },
            success:function(data){
                console.log(data);
            },
            error:function(xhr,err){
                console.log(err)
            }
        })
        })




        var search = localStorage.setId;
        $.ajax({
            url:"http://192.168.3.27:9999/oaSystem/lookStu",
            dataType:"json",
            type:"post",
            data:{
                studentId:search,
                method:'look'
            },
            success:function(data){
                console.log(data);

                // 姓名
                $("#studentName").val(data.result[0].studentName)
                // 性别
                if (data.result[0].studentSex == '2') {
                    $('#setSex').val("女");
                } else {
                    $('#setSex').val("男");
                }
                // 年龄
                $("#studentAge").val(data.result[0].age)
                // 电话
                $("#studentPhone").val(data.result[0].telphone)
                // 学校
                $("#schoolName").val(data.result[0].schoolName)
                // 专业
                $("#major").val(data.result[0].major)
                // 微信
                $("#studentWX").val(data.result[0].weixin)
                // QQ
                $("#studentQQ").val(data.result[0].qq)
                // 意向学科
                $("#likeStudy option").html(data.result[0].subjectName)
                // 身份证
                $("#studentSFZ").val(data.result[0].idCard)
                // 紧急联系人姓名
                $("#emergencyName").val(data.result[0].emergencyName)
                // 紧急联系人电话
                $("#emergencyTelephone").val(data.result[0].emergencyContact)
                // 与本人的关系
                $("#relaTion").val(data.result[0].relationship)
                // 学制
                $("#educationSystme").val(data.result[0].eductionalSystme)
                // 年级
                $("#studentGarde").val(data.result[0].studentGrade)
                // 学生来源
                $("#likeStudy1 option").html(data.result[0].sourceName)
            }
        })
   
</script>


